﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
  public partial class DataContext
    {
      public List<SoXe> GetListSoXe()
        {
            return db.SoXes.ToList();
        }
      public SoXe GetSoXeById(Guid id)
        {
            return db.SoXes.Where(c => c.MaSX == id).FirstOrDefault();
        }
        public void DeleteSoXe(SoXe cthd)
        {
            db.Entry(cthd).State = EntityState.Deleted;
            db.SaveChanges();
        }
        public void InsertSoXe(SoXe cthd)
        {
            db.Entry(cthd).State = EntityState.Added;
            db.SaveChanges();
        }
        public void UpdateSoXe(SoXe cthd)
        {
            db.Entry(cthd).State = EntityState.Modified;
            db.SaveChanges();
        }
    }
}
